const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports  = {
    mode:"development",
    entry:"./src/index.js",
    output:{
        filename:"bundle.js",
        path:path.resolve(__dirname,"dist")
    },
    module:{
        rules:[
            {
                test:/\.css$/,
                exclude:/node_modules/,
                use:["style-loader","css-loader"]
            },
            {
                test:/\.(ttf|woff|svg|ttf|woff2|eot)$/,
                use:{
                    loader:"file-loader",
                    options:{
                        name:"font/[name].[hash:4].[ext]"
                    }
                }
            }
        ]
    },
    plugins:[
        new HtmlWebpackPlugin({
            template:"./src/main.html"
        })
    ]
}